package com.syg.springboot06.readConfig.dto;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

@Component
//@PropertySource(value = "classpath:syg.properties",encoding = "UTF-8")
@ConfigurationProperties("student")//绑定student开头的key,student后面的key与属性一一对应
//@Data //lombok依赖,生成getXxx与setXxx方法,且编译器需要安装插件
public class StudentDto {
    private String name;
    private int age;
    private double score;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public double getScore() {
        return score;
    }

    public void setScore(double score) {
        this.score = score;
    }

    @Override
    public String toString() {
        return "StudentDto{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", score=" + score +
                '}';
    }
}
